<%@ Page Language="C#" MasterPageFile="~/site.master" AutoEventWireup="true" CodeBehind="myaccount.aspx.cs" Inherits="JTC.MiniCommerce.Web.myaccount" Title="Untitled Page" %>
<%@ MasterType VirtualPath="~/site.master" %>
<%@ Register TagPrefix="MiniCommerce" TagName="Navigation" Src="~/controls/navigation/storenavigation.ascx" %>
<%--<%@ Register TagPrefix="MiniCommerce" TagName="Address" Src="~/controls/address.ascx" %>
--%>
<%@ Register TagPrefix="MiniCommerce" TagName="AddressDisplay" Src="~/controls/addressdisplay.ascx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <div id="threeColumnLeftContent">
    <MiniCommerce:Navigation ID="navigation" runat="server" />
  </div>
  <div id="threeColumnRightContent">
  </div>
  <div id="threeColumnMainContent">
    <div id="site_centercontent">
      <div class="sectionHeader"><asp:Label ID="lblMyAccount" runat="server" /></div><br />
      <asp:Panel ID="pnlUser" runat="server">
        <asp:Label ID="lblUserName" runat="server" CssClass="label" /><br />
        <asp:Label ID="lblUserNameDisplay" runat="server" CssClass="label" /><br /><br />
        <asp:Label ID="lblPassword" runat="server" CssClass="label" /><br />
        <asp:LinkButton ID="lbChangePassword" runat="server" CssClass="label" OnClick="lbChangePassword_Click" /><br /><br />
        <asp:Label ID="lblEmail" runat="server" CssClass="label" /><br />
        <asp:Label ID="lblEmailDisplay" runat="server" CssClass="label" />&nbsp;&nbsp;<asp:LinkButton ID="lbChangeEmail" runat="server" CssClass="label" OnClick="lbChangeEmail_Click" /><br /><br />
<%--        <asp:Label ID="lblSecurityQuestion" runat="server" CssClass="label" /><br />
        <asp:LinkButton ID="lbChangeSecurityQuestion" runat="server" CssClass="label" /><br /><br /> --%>
<%--        <MiniCommerce:Address ID="billingAddresses" runat="server" AddressType="BillingAddress" />      
--%>  
      </asp:Panel>
      <asp:Panel ID="pnlMyOrders" runat="server">
        <asp:DataGrid ID="dgOrders" runat="server" AutoGenerateColumns="false" SkinID="adminDataGrid">
          <Columns>
            <asp:TemplateColumn>
              <ItemTemplate>
                <asp:LinkButton ID="lbView" runat="server" CommandArgument='<%# Eval("OrderId") %>' OnCommand="lbView_Click" />
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="OrderNumber" />
            <asp:TemplateColumn>
              <ItemTemplate>
                <%# GetFormattedAmount(Eval("Total").ToString()) %>
              </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn>
              <ItemTemplate>
                <%# (Eval("OrderStatusDescriptor.Name")) %>
              </ItemTemplate>
            </asp:TemplateColumn>            
          </Columns>
        </asp:DataGrid>
      </asp:Panel>
      
      <asp:Panel ID="pnlBillingAddresses" runat="server" CssClass="billingAddresses">&nbsp;    
        <asp:Repeater ID="rptrBillingAddresses" runat="server">
          <ItemTemplate>
            <MiniCommerce:AddressDisplay ID="dcBillingAddress" runat="server" />
          </ItemTemplate>
        </asp:Repeater>
      </asp:Panel>
      <asp:Panel ID="pnlShippingAddresses" runat="server" CssClass="shippingAddresses">&nbsp;    
        <asp:Repeater ID="rptrShippingAddresses" runat="server">
          <ItemTemplate>
            <MiniCommerce:AddressDisplay ID="dcShippingAddress" runat="server"  />
          </ItemTemplate>
        </asp:Repeater>
      </asp:Panel>
            
      <!-- //TODO: CMC - This control needs localization -->
      <asp:Panel ID="pnlChangePassword" runat="server" Visible="false">
        <asp:ChangePassword ID="cpChangePassword" runat="server" OnCancelButtonClick="HideChangePassword" OnContinueButtonClick="HideChangePassword" >
          <CancelButtonStyle CssClass="button" />
          <ContinueButtonStyle CssClass="button" />
          <ChangePasswordButtonStyle CssClass="button" />
        </asp:ChangePassword>
      </asp:Panel>
      <asp:Panel ID="pnlChangeEmail" runat="server" Visible="false">
        <asp:Label ID="lblPasswordChange" runat="server" CssClass="label" /><br />
        <asp:TextBox ID="txtPassword" TextMode="Password" runat="server" CssClass="textbox" /><asp:RequiredFieldValidator ID="rfvPassword" runat="server" ControlToValidate="txtPassword" ErrorMessage="*" /><br /><br />
        <asp:Label ID="lblEmailChange" runat="server" CssClass="label" /><br />
        <asp:TextBox ID="txtEmail" TextMode="SingleLine" runat="server" CssClass="textbox" /><asp:RequiredFieldValidator ID="rfvEmail" runat="server" ControlToValidate="txtEmail" ErrorMessage="*" /><br /><br />
        <asp:Label ID="lblEmailConfirmation" runat="server" CssClass="label" /><br />
        <asp:TextBox ID="txtEmailConfirmation" TextMode="SingleLine" runat="server" CssClass="textbox" /><asp:RequiredFieldValidator ID="rfvEmailConfirmation" runat="server" ControlToValidate="txtEmailConfirmation" ErrorMessage="*" /><br /><br />
        <asp:CompareValidator ID="cvEmailAddresses" runat="server" ControlToCompare="txtEmailConfirmation" ControlToValidate="txtEmail" Type="String" CssClass="label" />
        <asp:Button ID="btnEmailCancel" runat="server" CssClass="button" CausesValidation="False" OnClick="btnEmailCancel_Click" />&nbsp;
        <asp:Button ID="btnEmailSave" runat="server" CssClass="button" OnClick="btnEmailSave_Click" />
      </asp:Panel>
    </div>
  </div>  
</asp:Content>
